package com.itehima.Buffer;

import java.awt.image.WritableRenderedImage;
import java.io.*;

public class Demo01 {
    public static void main(String[] args) throws IOException {

        //学习字节缓冲流，实际操作对象还是基本流
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("c.txt"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("bbb.txt"));
        //读取文件中的内容，一个字节一个字节实现
//        int b;
//        while ((b=bis.read())!=-1)
//        {
//            bos.write((char)b);
//        }
//        bos.close();
//        bis.close();
        byte[] bytes=new byte[1024];
        int len;
        while ((len=bis.read(bytes))!=-1)
        {
            bos.write(bytes,0,len);
        }
        bos.close();
        bis.close();

    }
}
